import express from 'express';
import ComponentVersionController from '../controllers/componentVersion.controller.js';

const router = express.Router();


/**
 * 组件版本相关路由
 */
router.get('/', ComponentVersionController.getAllComponentVersions);
router.get('/:id', ComponentVersionController.getComponentVersionById);
router.get('/component/:componentId', ComponentVersionController.getComponentVersionsByComponentId);
router.get('/component/:componentId/active', ComponentVersionController.getActiveComponentVersionByComponentId);
router.post('/', ComponentVersionController.createComponentVersion);
router.put('/:id', ComponentVersionController.updateComponentVersion);
router.put('/:id/active', ComponentVersionController.setComponentVersionActive);
router.delete('/:id', ComponentVersionController.deleteComponentVersion);

export default router;
